<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">

<h:body>


<h:form id="form">  
  
    <p:growl id="messages" showDetail="true"/>  
  
    <p:dataTable var="product" selection="#{productBean.selectedProduct}" selectionMode="single"    rowKey="#{product.productId}" value="#{productBean.productList}"   id="productList"  >  
  
        <f:facet name="header">  
            Product List  
        </f:facet>  
  
        <p:column headerText="Id" style="width:125px">  
            <p:cellEditor>  
                <f:facet name="output">  
                    <h:outputText value="#{product.productId}" />  
                </f:facet>  
                <f:facet name="input">  
                    <p:inputText value="#{product.productId}" style="width:100%"/>  
                </f:facet>  
            </p:cellEditor>  
        </p:column>  
  
        <p:column headerText="productName" style="width:325px">  
            <p:cellEditor>  
                <f:facet name="output">  
                    <h:outputText value="#{product.productName}" />  
                </f:facet>  
                <f:facet name="input">  
                    <p:inputText value="#{product.productName}" style="width:100%" label="Year"/>  
                </f:facet>  
            </p:cellEditor>  
        </p:column>
        
         <p:column headerText="categoryId" style="width:125px">  
            <p:cellEditor>  
                <f:facet name="output">  
                    <h:outputText value="#{product.categoryId}" />  
                </f:facet>  
                <f:facet name="input">  
                    <p:inputText value="#{product.categoryId}" style="width:100%" label="Year"/>  
                </f:facet>  
            </p:cellEditor>  
        </p:column>
  
        <p:column headerText="globalpriceFlag" style="width:125px">  
            <p:cellEditor>  
                <f:facet name="output">  
                    <h:outputText value="#{product.globalpriceFlag}" />  
                </f:facet>  
                <f:facet name="input">  
                <p:inputText value="#{product.globalpriceFlag}" style="width:100%" label="Year"/> 
                </f:facet>  
            </p:cellEditor>  
        </p:column>  
        
        <p:column headerText="globalprice" style="width:125px">  
            <p:cellEditor>  
                <f:facet name="output">  
                    <h:outputText value="#{product.globalprice}" />  
                </f:facet>  
                <f:facet name="input">  
                <p:inputText value="#{product.globalprice}" style="width:100%" label="Year"/> 
                </f:facet>  
            </p:cellEditor>  
        </p:column>
        
        <p:column headerText="displayOrder" style="width:125px">  
            <p:cellEditor>  
                <f:facet name="output">  
                    <h:outputText value="#{product.displayOrder}" />  
                </f:facet>  
                <f:facet name="input">  
                <p:inputText value="#{product.displayOrder}" style="width:100%" label="Year"/> 
                </f:facet>  
            </p:cellEditor>  
        </p:column>
        
         <p:column headerText="isMan" style="width:125px">  
            <p:cellEditor>  
                <f:facet name="output">  
                    <h:outputText value="#{product.isMan}" />  
                </f:facet>  
                <f:facet name="input">  
                <p:inputText value="#{product.isMan}" style="width:100%" label="Year"/> 
                </f:facet>  
            </p:cellEditor>  
        </p:column>  

        <p:column headerText="discountFlag" style="width:125px">  
            <p:cellEditor>  
                <f:facet name="output">  
                    <h:outputText value="#{product.discountFlag}" />  
                </f:facet>  
                <f:facet name="input">  
                <p:inputText value="#{product.discountFlag}" style="width:100%" label="discountFlag"/> 
                </f:facet>  
            </p:cellEditor>  
        </p:column>
        
         <p:column headerText="discountPrice" style="width:125px">  
            <p:cellEditor>  
                <f:facet name="output">  
                    <h:outputText value="#{product.discountPrice}" />  
                </f:facet>  
                <f:facet name="input">  
                <p:inputText value="#{product.discountPrice}" style="width:100%" label="discountPrice"/> 
                </f:facet>  
            </p:cellEditor>  
        </p:column>
        
        <p:column headerText="activeStartTime" style="width:125px">  
            <p:cellEditor>  
                <f:facet name="output">  
                    <h:outputText value="#{product.activeStartTime}"  >  
		                <f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss"/>  
		            </h:outputText>
                </f:facet>  
                <f:facet name="input">  
                <p:inputText value="#{product.activeStartTime}" style="width:100%" label="activeStartTime"/> 
                </f:facet>  
            </p:cellEditor>  
        </p:column> 
        
        <p:column headerText="activeEndTime" style="width:125px">  
            <p:cellEditor>  
                <f:facet name="output">  
                     <h:outputText value="#{product.activeEndTime}"  >  
		                <f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss"/>  
		            </h:outputText>  
                </f:facet>  
                <f:facet name="input">  
                <p:inputText value="#{product.activeEndTime}" style="width:100%" label="activeEndTime"/> 
                </f:facet>  
            </p:cellEditor>  
        </p:column>    
         
        
        <f:facet name="footer">  
            <p:commandButton  id="addProductButton" value="Add" icon="ui-icon-add"  action="#{productBean.addProductInput}" update=":centerContentPanel" /> 
            <p:commandButton  id="editProductButton" value="Edit" icon="ui-icon-edit"  action="#{productBean.editProductInput}" update=":centerContentPanel" />
            <p:commandButton  id="deleteProductButton" value="Delete" icon="ui-icon-edit"  action="#{productBean.onDelete}" update=":centerContentPanel" /> 
            <p:commandButton  id="addImages" value="AddImages" icon="ui-icon-add"  action="#{productBean.addImageInput}" update=":centerContentPanel" />
            <p:commandButton  id="addProductInstance" value="addProductInstance" icon="ui-icon-add"  action="#{productBean.addProductInstance}" update=":centerContentPanel" />      
        </f:facet>
        
        
  
    </p:dataTable>  
    
</h:form> 



<!-- 	<h:form prependId="false"> -->

<!-- 		<p:dataTable id="dataTable" var="product" value="#{productBean.productList}" style="font: normal 11px auto  Verdana, Arial, Helvetica,sans-serif;" -->
<!-- 			paginator="true" rows="10" -->
<!-- 			paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" -->
<!-- 			rowsPerPageTemplate="5,10,15"> -->
<!-- 			<f:facet name="header">   -->
<!--             Product List   -->
<!--            </f:facet> -->

<!-- 			<p:column> -->
<!-- 				<f:facet name="header"> -->
<!-- 					<h:outputText value="Id" /> -->
<!-- 				</f:facet> -->
<!-- 				<h:outputText value="#{product.productId}" /> -->
<!-- 			</p:column> -->

<!-- 			<p:column> -->
<!-- 				<f:facet name="header"> -->
<!-- 					<h:outputText value="productName" /> -->
<!-- 				</f:facet> -->
<!-- 				<h:outputText value="#{product.productName}" /> -->
<!-- 			</p:column> -->

<!-- 			<p:column> -->
<!-- 				<f:facet name="header"> -->
<!-- 					<h:outputText value="globalpriceFlag" /> -->
<!-- 				</f:facet> -->
<!-- 				<h:outputText value="#{product.globalpriceFlag}" /> -->
<!-- 			</p:column> -->

<!-- 			<p:column> -->
<!-- 				<f:facet name="header"> -->
<!-- 					<h:outputText value="globalprice" /> -->
<!-- 				</f:facet> -->
<!-- 				<h:outputText value="#{product.globalprice}" /> -->
<!-- 			</p:column> -->
<!-- 		</p:dataTable> -->

<!-- 	</h:form> -->
</h:body>
</html>